<table width='600' height='975' align='center' class='Normal' border='0' >

<?php 
	if($intItemSoldStatus >= 100){
		$strLetterContent = "We have pleasure enclosing your cheque for all items that sold for more than £10.00. Any items marked as 'unsold' were 
		 offered for auction but didn't sell and are available for you to pick within 7 days from the date of the letter during 
		 opening hours (09:00 - 17:00 Mon - Fri or Sat 09:30 - 12:30). Any items not collected will be dealt with according to 
		 our business terms and conditions.";
	}else{
		$strLetterContent = "We are writing to inform that your items either did not sell and are marked as or sold for less than £10.00.
		In these circumstances no monies are due to you on this occassion. Any items not collected will be dealt with according to 
		 our business terms and conditions.";
	}
include (MODULE . "/action/qrySelectVendorDueCheque");

?>


<?php
if(!$myrow[0]==""){
     do {
	 	if($intVendorID != $myrow[ID])
			{

				
			echo $strEndTable;
			$intTotalAuctionSellingFee = 0;
			$intTotalOurCommission = 0;
			$intTotalPayVendor = 0;
?>

				<tr ALIGN="LEFT" VALIGN="middle" height="100">
					<TD COLSPAN="4"  WIDTH="600" HEIGHT="100"><IMG SRC='http://<?php echo $SERVER_NAME ?>/images<?php echo SITE_SUFFIX ?>/EmailHeader.jpg'  WIDTH="600" ALIGN="TOP" BORDER="0"></TD>
				</tr>
	
			
			
			     <tr valign="top" height="225">
			         <td align='left' colspan='4'>
					 	<br/><br/><br/>
					 	<?php echo DisplayLookupValue("tblTitle","Title",$myrow[Title])."&nbsp;".$myrow[FirstName]."&nbsp;".$myrow[Surname]."</a>"?><br/>

					 	<?php
						if($myrow[CompanyName]){
							echo $myrow[CompanyName]."<br/>";
						}
			             
						 echo $myrow[Address1]?><br/>
			
						<?php
						if($myrow[Address2]){
							echo $myrow[Address2]."<br/>	";
						}
			
						echo "
			             ".$myrow[Town]."<br/>
			             ".$myrow[County]."<br/>
			             ".strtoupper($myrow[PostalCode])."<br/>";
						 if($myrow[Country] != 202){
				             echo DisplayLookupValue("tblCountry","Country",$myrow[Country])."<br/>";
						}
					?>

					 	 <div align="right"><?php echo  ( date(" d F Y") ).printActionResults();?></div>
			             <br/><br/><br/><strong>Customer Number</strong> <?php echo str_pad($myrow[ID], 10, "0", STR_PAD_LEFT);?>
						 <br/><br/><br/>
						 Dear <?php echo DisplayLookupValue("tblTitle","Title",$myrow[Title])."&nbsp;".$myrow[Surname]."</a>"?>
						 <br/><br/>
						 <?php echo $strLetterContent; ?>
			         	<br/>
						<br/>
					 </td>
			     </tr>
				 
				 <tr height='8' valign="top">  

					<td align='left'  width='420'>
						<strong>Item</strong>
					
					</td>
					
					<td align='right' width='60'>
					
						<strong>Sold</strong>
					</td>
					
					<td align='right' width='60'>
						<strong>Commission</strong>
					
					</td>
					<td align='right' width='60'>
						<strong>Pay</strong>
					
					</td>
				
				</tr>


		<?php

	 		}else{

			
			}
			$intTotalAuctionSellingFee += $myrow[AuctionSellingFee];
			$intTotalOurCommission += $myrow[OurCommission];
			$intTotalPayVendor += $myrow[PayVendor];
			

	 		$intVendorID = $myrow[ID];
			
	 ?>

         
				<tr height='8' valign="top">  

					<td align='left'  width='480'>
						<? echo $myrow[ItemName]?>
					
					</td>
					
					<td align='right' width='40'>
					
						<? 
							if($myrow[AuctionSellingFee] == 0){
								echo "Unsold";
							}else{
								echo CURRENCY.number_format($myrow[AuctionSellingFee], 2, '.', '');
							}
							?>
					</td>
					
					<td align='right' width='40'>
						<? echo CURRENCY.number_format($myrow[OurCommission], 2, '.', '')?>
					
					</td>
					<td align='right' width='40'>
						<? echo CURRENCY.number_format($myrow[PayVendor], 2, '.', '')?>
					
					</td>
				
				</tr>


<?php
			
		} while ($myrow = mysql_fetch_array($result));
	}
	?>
				<tr  height='8' valign="top">
					
					<td colspan='1' width='510'>
						&nbsp;
					
					</td>
					
					<td align='right' width='30'>
						<strong><?php //echo CURRENCY.number_format($intTotalAuctionSellingFee, 2, '.', '')?></strong>
					
					</td>
					
					<td align='right' width='30'>
						<strong>TOTAL <?php //CURRENCY.number_format($intTotalOurCommission, 2, '.', '')?></strong>
					
					</td>
					<td align='right' width='30'>
						<strong><?php echo CURRENCY.number_format($intTotalPayVendor, 2, '.', '') ?></strong>
					
					</td>
				
				</tr>
				<tr valign='top' >
					<td colspan='4'>
						<br/><br/><br/><br/>May we take this opportunity to thank you for your custom and look forward to see you again in the near future.
						<br/>
						<br/>Kind regards.
						<br/>
						<br/>Yours sincerely
						<br/>
						<br/>
						<br/>
						<br/>Delboys Lockup Ltd
					</td>
				
				</tr>		
			<tr valign='bottom'>
		 		<td colspan='4' align='center' class='small' height="8">
					<?php echo COMPANY_REGISTERED_ADDRESS."&nbsp;".VAT_NUMBER?>
				</td>
		    </tr>
		</td>
	</tr>
</table>